package com.pcbly.web.persistence.property;



import java.util.List;

import com.pcbly.web.bean.PropertyBean;
import com.pcbly.web.persistence.HibernateBaseDao;

public class PropertyHibernateDao extends HibernateBaseDao<PropertyBean>
		implements PropertyDao {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6241633313066002145L;
	
	public PropertyHibernateDao(){
		super();
	}
	protected Class<PropertyBean> getEntityClass(){
		return PropertyBean.class;
	}
	public void insertPropertyBean(PropertyBean bean)throws Exception{
		getHibernateTemplate().save(bean);
	}
	@SuppressWarnings("unchecked")
	@Override
	public List<PropertyBean> getPropertyListByName(String Name)
			throws Exception {
		// TODO Auto-generated method stub
		return getHibernateTemplate().find("from PropertyBean where name like ? ",new Object[]{Name+"%"});
	}
	@Override
	public void updatePropertyBean(PropertyBean bean) throws Exception {
		// TODO Auto-generated method stub
		super.saveObject(bean);
	}
}
